/** @jsxImportSource @emotion/react */
import * as React from "react";
import {Input, InputLine, LineColumn, Select, Text,
} from "customize-easy-ui-component";
import {InspectRecordLayout, InternalItemProps, useItemInputControl} from "../../common/base";
import {useMeasureInpFilter} from "../../common/hooks";

export const itemA下结论=['检验结论','检验日期',];
export const Conclusion=
    React.forwardRef((
        { children, show ,alone=true,redId,nestMd,label,}:InternalItemProps,  ref
    ) => {
      const [getInpFilter]=useMeasureInpFilter(null,itemA下结论,);
      const {inp, setInp} = useItemInputControl({ ref });
      return <InspectRecordLayout inp={inp} setInp={setInp} getInpFilter={getInpFilter} show={show} redId={redId}
                                  nestMd={nestMd} alone={alone} label={label!}>
        <Text variant="h5">{label}：</Text>
        <InputLine  label='检验结论' >
          <Select inputSize="md" css={{minWidth:'140px',fontSize:'1.3rem',padding:'0 1rem'}}
                  value={ inp?.检验结论  ||''} onChange={e => setInp({ ...inp, 检验结论: e.currentTarget.value||undefined}) }>
            <option></option>
            <option>符合</option>
            <option>不符合</option>
          </Select>
        </InputLine>
        <LineColumn column={4}>
          <InputLine label='设置检验日期'>
            <Input value={inp?.检验日期 || ''} type='date'
                   onChange={e => setInp({...inp, 检验日期: e.currentTarget.value})}/>
          </InputLine>
        </LineColumn>
      </InspectRecordLayout>;
});
